﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Cn.Edwon.Web.Support;
using Cn.Cellula.Model.Security;
using Cn.Edwon.Web;
using Cn.Cellula.Client;
using Cn.Edwon.Util;

namespace Cn.Cellula.MiniTopSite.Biz {
    public partial class MiniTop : MasterSupport {
        public String SiteBase = ClientHelper.RootUrl;
        public String CurrentUserId = "";
        protected void Page_Load(object sender, EventArgs e) {
            if (this.Actor != null) {
                CurrentUserId = this.Actor.ID;
                Page.Title = SiteConfig.BaseInfo.PageTitle + " " + Page.Title;
                if (!Page.IsPostBack) {
                    InitUserInfo();
                }
            } else {
                Response.Redirect(ClientHelper.RootUrl+ClientHelper.Ac.LoginUrl);
            }
        }
        private void InitUserInfo() {
            VSysUserEO user = (VSysUserEO)this.Actor.Src;
            this.ph_manage.Visible = (user.IsSysop == 1);
            this.lab_UserInfo.Text = this.Actor.UserName;
                //+ "," + user.DeptName
                //+ "," + user.Duty;
            this.img_Face.AlternateText = this.Actor.LastIP;
            this.img_Face.ImageUrl = "/cellula_client/default/face/default" + user.Gender + ".png";
        }
    }
}